from PyQt5.QtCore import QObject, pyqtSignal
from .protocol import ProtocolParser

class DataProcessor(QObject):
    data_updated = pyqtSignal(str)
    def __init__(self,protocol_parser: ProtocolParser):
        super().__init__()
        self.protocol_parser = protocol_parser
    def process(self,data: bytes):
        processed_data = self.protocol_parser.parse(data)
        self.data_updated.emit(processed_data)